package NineList;

import java.util.ArrayList;
import java.util.Iterator;

public class Arrays {

	public static void main(String[] args) {
		ArrayList a = new ArrayList();
		a.add(5);
		a.add(5);
		a.add(3);
		a.add(3);
		a.add(6);
		Iterator it = a.iterator();
		while(it.hasNext()){
			System.out.println(it.next());
		}
		a = newArray(a);
		System.out.println(a);
		
	}
	public static ArrayList newArray(ArrayList a){
		ArrayList newArr = new ArrayList();
		Iterator it = a.iterator();
		while(it.hasNext()){
			Object obj =it.next();
			if(!newArr.contains(obj)){
				newArr.add(obj);
			}
		}
		return newArr;
	}

}
